package com.example.simplesvc.entity;


import com.baomidou.mybatisplus.annotation.TableName;

import java.util.Date;

@TableName("node")
public class Node {
    private Long id;
    private String name;

    /**
     * 节点类型 0 worker  1 leader
     */
    private Integer nodeType;

    private Date createdTime;

    /**
     * 最近心跳时间
     */
    private Date lastAccessTime;

    /**
     * 节点活跃过期时间
     * leader节点不活跃，所有worker节点都可以竞争 leader
     * worker节点不活跃，那么 leader在分配任务是不在
     */
    private Date expireTime;


    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Integer getNodeType() {
        return nodeType;
    }

    public void setNodeType(Integer nodeType) {
        this.nodeType = nodeType;
    }

    public Date getCreatedTime() {
        return createdTime;
    }

    public void setCreatedTime(Date createdTime) {
        this.createdTime = createdTime;
    }

    public Date getLastAccessTime() {
        return lastAccessTime;
    }

    public void setLastAccessTime(Date lastAccessTime) {
        this.lastAccessTime = lastAccessTime;
    }

    public Date getExpireTime() {
        return expireTime;
    }

    public void setExpireTime(Date expireTime) {
        this.expireTime = expireTime;
    }
}
